#include<stdio.h>

int main()
{
	int t,min,s1=0,s2=0;
	scanf("%d",&t);
	for(min=1;min<=t;min++)
	{
		s1=3*min;
		if(min%10==1&&s2>s1) min+=29;
		else s2+=9;
	}
	s1=3*t;
	if(s1>s2) printf("@_@ %d",s1);
	if(s1==s2) printf("-_- %d",s1);
	if(s1<s2) printf("^_^ %d",s2);
	return 0;
}
